<template>
    <el-input v-model="loginStore.username" placeholder="Please input" />
    <el-input
    v-model="loginStore.pwd"
    type="password"
    placeholder="Please input password"
    show-password
  />
  <el-button type='primary' @click="onLogin">登陆</el-button>
  </template>

<script setup>
import {useLoginStore} from "@/stores/login.js"
//router
import {useRoute,useRouter,onBeforeRouteLeave} from 'vue-router'
const loginStore = useLoginStore();

const router = useRouter();
function onLogin() {
  //编程式导航
  // router.push('/index/products')
  router.push({name:'index'})
}

</script>